<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="部门" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<link href="/css/dtree.css" rel="stylesheet" type="text/css">
<script src="/js/dtree.js"></script>
<script language="javascript">
	function doTreeNodeClick(id){
		document.getElementById("currentId").value=id;
		parent.document.getElementById("mainFrame").src="/base/InnerPbList.ihtm?department_id="+id;
	}
	function doInit(){
		var defaultId="${defaultId}";
		if(defaultId!=""){
			doTreeNodeClick(defaultId);
			d.openTo(defaultId,true,false);
		}
	}
	function getFromUrl(){
		var defaultId="${defaultId}";
		var fromUrl="/base/DepartmentListForInnerPb.ihtm?default_id="+defaultId;
		return encodeURIComponent(fromUrl);
	}
</script>
</head>
<body oncontextmenu="return false" onLoad="doInit();" style="text-align:center" scroll="no">
			<div class="nav" id="scrollDiv" style="text-align:left;overflow-x:hidden;overflow-y:auto;width:160px;height:508px">
			  <h3 class="title">部门</h3>
			  <div class="nav-link nav-mail" style="width:100%">
						<input type="hidden" name="currentId" id="currentId" value="">							
						<div class="blank12"></div>
						
						<script language="javascript">
							<!--
							var isOpen=false;
							var d = new dTree('d','/images/dtree');
							
							d.config.useCookies=false;
							d.config.useLines=true;
							d.config.useIcons=true;
							
							d.add(0,-1,'Root');
							<c:forEach var="item" items="${departmentList}">
								d.add(${item.id},${item.parentId},'<c:out value="${item.departmentName}" />',"javascript:doTreeNodeClick('${item.id}');",'','','',false);
							</c:forEach>
							
							document.write(d);
							d.closeAll();
							//-->
						</script>
			  </div>
			</div>
</body>
</html>